<?php

namespace app\admin\model;

use think\model\Relation;

class News extends Relation {

        protected $link = [
            'news_category' => [
		'mapping_type' => BELONGS_TO,
		'class_name' => 'News_category',
		'foreign_key' => 'cid',
		'mapping_fields' => 'title',
		'as_fields' => 'title',
		'parent_key' => 'id'
	    ],
            'member' => [
                'mapping_type' => BELONGS_TO,
                'class_name' => 'Member',
                'foreign_key' => 'uid',
                'mapping_fields' => 'realname as uname',
                'as_fields' => 'uname',
                'parent_key' => 'id'
            ]
        ];

}
